package demo;

import java.util.Scanner;

public class StopDemo {

    static class SubThread extends Thread{

        public void run(){
            while(true){
                System.out.println("A");
            }
        }
    }

    public static void main(String[] args) {
        SubThread subThread=new SubThread();
        subThread.start();
         Scanner scanner=new Scanner(System.in);
         scanner.nextLine();
         //直接杀死线程，一般不使用，使用已经产生的中间数据可能会损毁
         subThread.stop();
    }
}
